<?php
class BaseController extends Zend_Controller_Action {
  public function init(){
      header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
      //header("Cache-Control:no-cache,must-revalidate");
      //header("Pragma: no-cache");
      header("Content-type:text/html;charset=utf-8");

      session_start();
      if(!isset($_SESSION['username']) || !isset($_SESSION['lastlogin'])){
          echo '<script>window.parent.location.href="'.ADMIN_PATH.'/Login"</script>';
          exit();
      }
      $this->view->username = $_SESSION['username'];
      $this->view->lastlogin = date("Y年m月d日 h:i", $_SESSION['lastlogin']);
  }

}
